import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { InventoryComponent } from './pages/inventory-table/inventory.component';
import { InventoryDetailComponent } from './pages/inventory-detail/inventory-detail.component';
import { AccountComponent } from './pages/account-table/account.component';
import { AccountDetailComponent } from './pages/account-detail/account-detail.component';
import { PriceComponent } from './pages/price-table/price.component';
import { PriceDetailComponent } from './pages/price-detail/price-detail.component';
import { PayComponent } from './pages/pay-table/pay.component';
import { PayDetailComponent } from './pages/paye-detail/pay-detail.component';
import { ClosedComponent } from './pages/closed-table/closed.component';
import { ClosedDetailComponent } from './pages/closede-detail/closed-detail.component';
const routes: Routes = [
    {
        path: 'inventory',
        component: InventoryComponent,
        children: [
            {
                path: 'detail', component: InventoryDetailComponent, data: {
                    breadcrumbs: [{ title: '库存列表', path: '/inventory/inventory' }, { title: '添加库存' }]
                }
            },
            {
                path: 'detail/:id', component: InventoryDetailComponent, data: {
                    breadcrumbs: [{ title: '库存列表', path: '/inventory/inventory' }, { title: '库存详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '库存列表' }]
        }
    },
    {
        path: 'Account',
        component: AccountComponent,
        children: [
            {
                path: 'detail', component: AccountDetailComponent, data: {
                    breadcrumbs: [{ title: '资产列表', path: '/inventory/Account' }, { title: '添加资产' }]
                }
            },
            {
                path: 'detail/:id', component: AccountDetailComponent, data: {
                    breadcrumbs: [{ title: '资产列表', path: '/inventory/Account' }, { title: '资产详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '资产列表' }]
        }
    },
    {
        path: 'price',
        component: PriceComponent,
        children: [
            {
                path: 'detail', component: PriceDetailComponent, data: {
                    breadcrumbs: [{ title: '余额列表', path: '/inventory/price' }, { title: '添加余额' }]
                }
            },
            {
                path: 'detail/:id', component: PriceDetailComponent, data: {
                    breadcrumbs: [{ title: '余额列表', path: '/inventory/price' }, { title: '余额详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '余额列表' }]
        }
    },
    {
        path: 'pay',
        component: PayComponent,
        children: [
            {
                path: 'detail', component: PayDetailComponent, data: {
                    breadcrumbs: [{ title: '应付列表', path: '/inventory/pay' }, { title: '添加应付' }]
                }
            },
            {
                path: 'detail/:id', component: PayDetailComponent, data: {
                    breadcrumbs: [{ title: '应付列表', path: '/inventory/pay' }, { title: '应付详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '应付列表' }]
        }
    },
    {
        path: 'closed',
        component: ClosedComponent,
        children: [
            {
                path: 'detail', component: ClosedDetailComponent, data: {
                    breadcrumbs: [{ title: '应收列表', path: '/inventory/closed' }, { title: '添加应收' }]
                }
            },
            {
                path: 'detail/:id', component: ClosedDetailComponent, data: {
                    breadcrumbs: [{ title: '应收列表', path: '/inventory/closed' }, { title: '应收详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '应收列表' }]
        }
    },
];

export const declarationComponents = [
    InventoryComponent,
    InventoryDetailComponent,
    AccountComponent,
    AccountDetailComponent,
    PriceComponent,
    PriceDetailComponent,
    PayDetailComponent,
    PayComponent,
    ClosedComponent,
    ClosedDetailComponent
];

export const entryComponents = [
];

@NgModule({
    imports: [
        RouterModule.forChild(routes)
    ],
    exports: [
        RouterModule
    ]
})
export class InventoryRoutingModule { }
